package face.pay.web.order.controller;

import face.pay.common.order.IOrderAnalysisService;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.util.ResultMessage;
import face.pay.util.page.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/analysis")
public class OrderAnalysisController {

    @Autowired
    IOrderAnalysisService iOrderAnalysisService;

    /**
     * 前7日交易统计
     * @param loginUser
     * @param startTime
     * @return
     */
    @RequestMapping("/days7orders")
    @ResponseBody
    public ResultMessage manager(@CurrentUser UserInfo loginUser, String  startTime) {

          Map map =    iOrderAnalysisService.volumeTrade(startTime,loginUser);

          return       ResultMessage.createSuccess(map);
    }
}
